<!--
 * Date: 2019年11月20日 15:08:11
 * LastEditors: lvyou
 * LastEditTime: 2019年12月13日 18:00:35
 * FilePath: \youlinweb-master\src\components\statistics\numcommon.vue
 * copyright(c) 2019-2025 版权为浙江双城网络科技集团有限公司所有，违者必究。
 -->
<template>
  <div
    class="bg1 bg2 a-c text-center"
    :class="[{'old-bg2':type>0&&type<7},{'old-bg5':type==4},{'new-bg3':type==6}]"
  >
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-new2-cloud.gif" class="firework" v-if="type!=6" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-new2-mouse.gif" class="firework" v-if="type!=6" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-new2-txt.gif" class="firework" v-if="type==0" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-new2-mouse.gif" class="firework" v-if="type==0" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-hands.gif" class="firework" v-if="type==2" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-money.gif" class="firework" v-if="type==1||type==2||type==3||type==5" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-qian.gif" class="firework" v-if="type==2" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-love.gif" class="firework" v-if="type==3" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-park.gif" class="firework" v-if="type==3" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-ping.gif" class="firework" v-if="type==3" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old5-mouse@2x.png" class="old5-mouse" v-if="type==4" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old6-lvb.gif" class="firework" v-if="type==5" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-twomouse.gif" class="title1 twomouse" v-if="type==6" />
    <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-all-right.gif" class="firework" v-if="type!=0&&type!=6" />
    <div class="old2-text-wrap flex-colum" v-if="type==1">
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-time.png" class="old2-time" />
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-enter.png" class="old2-enter" />
        <span class="statistics-text-style">{{form.loginTimes||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="old2-txt2" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt.gif" class="old2-txt" v-if="type==1" />
    </div>
    <div class="old3-text-wrap flex-colum" v-if="type==2">
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-all.png" class="old3-all" />
        <span class="statistics-text-style">{{form.signTimes||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="statistics-text-ci" />
      </div>
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-continue.png" class="old3-continue" />
        <span class="statistics-text-style">{{form.ontinuousSignTimes||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="statistics-text-ci" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old3-bottom.png" class="old3-bottom" />
    </div>
    <div class="old4-text-wrap flex-colum" v-if="type==3">
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-allcommon.png" class="old4-allcommon" />
        <span class="statistics-text-style">{{form.commentTimes||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="statistics-text-ci" />
      </div>
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-foot.png" class="old4-foot" />
        <span class="statistics-text-style">{{form.parkNum||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-txt3@2x.png" class="old4-txt3" />
      </div>
      <div class="v-c" style="font-size:0">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-inside.png" class="old4-inside" />
        <span class="statistics-text-style">{{form.commentMostUser||"小绿"}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-txt2@2x.png" class="old4-txt2" />
        <span class="statistics-text-style">{{form.commentMostUserCount||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="statistics-text-ci" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old4-bottom.png" class="old4-bottom" />
    </div>
    <div class="old5-text-wrap flex-colum" v-if="type==4">
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old5-year.png" class="old5-year" />
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old5-allcomment.png" class="old5-allcomment" />
        <span class="statistics-text-style">{{form.leaveMessage||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old2-txt2@2x.png" class="statistics-text-ci" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old5-txt.gif" class="old5-txt"  />
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old5-bottom.png" class="old5-bottom" />
    </div>
    <div class="old6-text-wrap flex-colum" v-if="type==5">
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old6-gain.png" class="old6-gain" />
        <span class="statistics-text-style">{{form.gainCoin||0}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old6-txt3@2x.png" class="old6-txt3" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-txt-old6@2x.png" class="txt-old6" />
      <div class="v-c">
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old6-bottom.png" class="old6-bottom" />
        <span class="statistics-text-style">{{Math.floor(form.gainCoin/10||0)}}</span>
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old6-txt4@2x.png" class="old6-txt4" />
      </div>
    </div>
    <div class="old7-text-wrap flex-colum" v-if="type==6">
      <div class="flex old7-content-wrap">
        <img :src="form.headImg" class="statistics-avatar" />
        <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old7-txt@2x.png" class="old7-txt" />
      </div>
      <img src="https://youlingqinius.wonderlandnet.cn/statistics-youlin-old7-sh.gif" class="old7-sh" @click="goTopicDetail">
    </div>
  </div>
</template>

<script>
import api from "src/api/index";
export default {
  name: "numcommon",

  components: { api },

  props: {
    type: {
      //0新，1旧,2-old3
      type: Number,
      default: -1
    },
    form: {
      type: Object,
      default: {}
    }
  },

  data() {
    return {
      isClick: false
    };
  },

  watch: {},

  created() {},

  mounted() {},

  destroyed() {},

  methods: {
    goTopicDetail() {
      if (this.isClick) {
        return;
      }
      this.isClick = true;
      let that = this;
      const data = {
        topicId: this.form.topicId,
        parentId: "",
        type: 0,
        peplyId: "",
        // content:`我登陆生活秀已经${this.form.loginTimes||0}次啦，获得了${this.form.gainCoin||0}绿币，快去看看你可以赚多少吧！点击→?//:`,
        content: `${this.form.loginYear}年${this.form.loginMonth}月${this.form.loginDay}日我第一次邂逅【幸福生活】，是绿城第${this.form.userId}位进入生活秀的业主。2019年我一共签到了${this.form.signTimes}天，赚了${this.form.gainCoin}绿币，超开心的~你也快来看看自己2019年的战绩吧！点击→?//:`,
        picUrls: "",
        parentType: "",
        id: null,
        token: localStorage.getItem("token"),
        draft: 0 //草稿
      };
      api
        .QuerytopicAddComment(data)
        .then(res => {
          this.isClick = false;
          if (res.success) {
            that.$toast("发布讨论成功");
            if (this.form.receiveCoin == 0) {
              this.addCoin();
            } else {
              this.$router.push({
                path: "/topicdetail",
                query: { topicId: this.form.topicId }
              });
            }
          } else {
            that.$toast(res.msg);
          }
        })
        .catch(error => {
          this.isClick = false;
          //  that.showImg = true
        });
    },
    addCoin() {
      api.addCoin().then(res => {
        if (res.code != 0) {
          this.$toast(res.msg);
        } else {
          this.dialog(`恭喜您获得${res.data.receiveCoinNum || 0}绿币`);
          this.$router.push({
            path: "/topicdetail",
            query: { topicId: this.form.topicId }
          });
        }
      });
    }
  }
};
</script>

<style lang="less">
.statistics-container {
  .statistics-text-style {
    font-size: 0.48rem;
    color: #ffde00;
    padding: 0 3px;
  }
  .statistics-text-ci {
    width: 0.49rem;
    height: 0.44rem;
  }
  .bg2 {
    background: url("https://youlingqinius.wonderlandnet.cn/statistics-youlin-bg2.png") no-repeat;
    background-size: 100% 100vh;
  }
  .old-bg2 {
    background: url("https://youlingqinius.wonderlandnet.cn/statistics-youlin-bg-old2.png") no-repeat;
    background-size: 100% 100vh;
    .old2-text {
      width: 5.82rem;
      height: 1.12rem;
    }
    .old2-text2 {
      height: 0.4rem;
    }
    .statistcs-common-text {
      color: #ffde00;
      font-size: 0.48rem;
    }
    .old2-text-wrap {
      width: 100%;
      margin: 0 0 0 0.78rem;
      .old2-txt{
        width: 5.53rem;
        height: 1.15rem;
        margin-left: -0.1rem;
      }
      .old2-time {
        width: 5.24rem;
        height: 0.51rem;
      }
      .old2-enter {
        width: 4.24rem;
        height: 0.51rem;
      }
      .old2-txt2 {
        width: 0.49rem;
      }
    }
    .old3-text-wrap {
      width: 100%;
      margin: 0.2rem 0 0 0.7rem;
      .old3-all {
        width: 2.57rem;
        height: 0.53rem;
      }
      .old3-continue {
        width: 3.67rem;
        height: 0.54rem;
      }
      .old3-bottom {
        width: 5.84rem;
        height: 1.76rem;
      }
    }
    .old4-text-wrap {
      width: 100%;
      margin: 0.2rem 0 0 0.8rem;
      .old4-allcommon {
        width: 3.73rem;
        height: 0.48rem;
      }
      .old4-foot {
        width: 2.05rem;
        height: 0.53rem;
      }
      .old4-txt3 {
        width: 1.45rem;
        height: 0.53rem;
      }
      .old4-inside {
        width: 1.58rem;
        height: 0.53rem;
      }
      .old4-txt2 {
        width: 1.01rem;
        height: 0.48rem;
      }
      .old4-bottom {
        width: 4.49rem;
        height: 1.15rem;
      }
    }
    .old6-text-wrap {
      width: 100%;
      margin: 0 0 0 0.6rem;
      .old6-gain {
        width: 4.28rem;
        height: 0.48rem;
      }
      .old6-txt3 {
        width: 0.92rem;
        height: 0.5rem;
      }
      .txt-old6 {
        width: 3.96rem;
        height: 1.07rem;
      }
      .old6-bottom {
        width: 3.14rem;
        height: 0.49rem;
      }
      .old6-txt4 {
        width: 0.7rem;
        height: 0.48rem;
      }
    }
  }
  .old-bg5 {
    background: url("https://youlingqinius.wonderlandnet.cn/statistics-youlin-bg-old5.png") no-repeat;
    background-size: 100% 100vh;
    .old5-text-wrap {
      width: 100%;
      margin: 2rem 0 0 0.7rem;
      .old5-year {
        width: 4.22rem;
        height: 0.5rem;
      }
      .old5-txt{
        width:1.8rem;
        height: 0.75rem;
        margin:-0.1rem 0 -0.1rem -0.2rem;
      }
      .old5-allcomment {
        width: 2rem;
        height: 0.47rem;
      }
      .old5-bottom {
        width: 5.02rem;
        height: 2.39rem;
      }
    }
    .old2-text {
      height: 4.06rem;
      width: 5.03rem;
    }
  }
  .new-bg3 {
    background: url("https://youlingqinius.wonderlandnet.cn/statistics-youlin-bg3.png") no-repeat;
    background-size: 100% 100vh;
    .old7-text-wrap {
      width: 100%;
      height: 6.4rem;
      position: relative;
      margin: 1.5rem 0 0 0.5rem;
      .old7-content-wrap{
        width:5.6rem;
        // height: 4.8rem;
        margin-bottom: 0.2rem;
      }
      .statistics-avatar {
        position: absolute;
        left: 0;
        top: 0;
      }
      .old7-sh{
        width: 2.6rem;
        height: 0.76rem;
      }
      .old7-txt {
        width: 5.56rem;
        height: 4.71rem;
        margin: 0.3rem 0 0 0;
      }
    }
  }
}
.old5-mouse {
  width: 100%;
  height: 3.5rem;
  bottom: 0;
  position: absolute;
}
</style>

